import {HashRouter, Routes, Route, NavLink, Navigate, Outlet} from 'react-router-dom';
// import A from './view/dom4'
// import B from './view/route-dom/a.jsx'
// import C from './view/route-dom/b.jsx'
// import A1 from './view/dom1'
import RouterView from './router6.0'
/*
* Navigate  重定向
*   to属性可以接收一个对象
*       pathname: 跳转路径
        search： ？拼接传参
* */


/*
* 二级路由
* 通过Outlet渲染二级路由页面
*
* import { Link , Outlet} from "react-router-dom";
* <Outlet/>
*
* */

function App() {
    return (
        <HashRouter>
            <div>
                <NavLink to='/a'>Dom1</NavLink>
                <NavLink to='/b'>Dom2</NavLink>
                <NavLink to='/c'>Dom3</NavLink>
            </div>
            <div>
                {/*<Routes>*/}
                {/*    <Route path='/' element={<Navigate to='/a'/>}/>*/}
                {/*    <Route path='/a' element={<A/>}>*/}

                {/*        <Route path='/a' element={<Navigate to='/a/a1'/>}/>*/}
                {/*        <Route path='/a/a1' element={<A1/>}/>*/}
                {/*    </Route>*/}
                {/*    <Route path='/b' element={<B/>}/>*/}
                {/*    <Route path='/c' element={<C/>}/>*/}
                {/*    <Route path='*' element={<Navigate to={{*/}
                {/*        pathname:'/a',*/}
                {/*        search:'?lx=404'*/}
                {/*    }}/>}/>*/}
                {/*</Routes>*/}
                <RouterView/>

            </div>
        </HashRouter>
    );
}

export default App;
